package com.wn.budget.model;

import com.wn.budget.code.BaseEntity;
import lombok.Data;

import javax.persistence.*;

/**
 * 模板材料
 *
 * @author : linyuebin
 * @date : 2019/11/7
 */
@Data
@Entity
public class TemplateMaterial extends BaseEntity {
    /**
     * 材料id
     */
    @Column(name = "material_id", length = 36)
    public String materialId;

    @OneToOne
    @JoinColumn(name = "material_id", updatable = false, insertable = false)
    public Material material;

    /// <summary>
    /// 用量
    /// </summary>
    public int quantity;

    /**
     * 模板空间id
     */
    @Column(length = 36)
    public String templateSpaceId;

    /**
     * 模板id
     */
    @Column(length = 36)
    public String templateId;
}
